$user = $this->get('security.token_storage')->getToken()->getUser(); $user->getUsername();